# python manage.py test --settings=iplatform.admin_settings

import unittest
from django.test import TestCase

from variables import rinse_times
from datetime import datetime

class TestDates(TestCase):
    
    def setUp(self):
        pass

    def testDates(self):
        dates = (
                 (datetime(2009, 2, 28, 17, 27, 41, 0), datetime(2009, 2, 28, 17, 0, 0, 0)),
                 (datetime(2009, 2, 28, 17, 47, 46, 718000), datetime(2009, 2, 28, 18, 0, 0, 0)),
                 (datetime(2009, 2, 28, 18, 0, 46, 718000), datetime(2009, 2, 28, 18, 0, 0, 0)),
                 (datetime(2009, 2, 28, 18, 25, 6, 124000), datetime(2009, 2, 28, 18, 0, 0, 0)),
                 (datetime(2009, 2, 28, 18, 35, 6, 124000), datetime(2009, 2, 28, 19, 0, 0, 0))
                 )
        
        for (in_d, out_d) in dates:
            print "WAS: ", in_d
            (nom, cd) = rinse_times(in_d, 60)
            print "NOW: ", nom, "\n"
            self.assertEqual(nom, out_d)
